<template>
	<view class="container">
		<view class="content_view">
			<view class="title_view Text77">
				请用手机NFC刷锁具
			</view>
			<image class="image_view" src="/static/images/smartLock/NFC.png">
			</image>
			<view class="Text00 des_view">
				正在扫描 ...
			</view>
			<view class="look_view" @click="cancel">
				取消
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {

			}
		},
		created() {
			
		},
		onLoad() {
			this.lockInfo()
		},
		methods: {
			lockInfo() {
				var that = this
				console.log("lockInfo")
				var chivoLockModule = uni.requireNativePlugin("ChivoLockModule")
				console.log("ChivoLockModule  == " + chivoLockModule)

				if (chivoLockModule != null) {
					chivoLockModule.lockInfo({}, (ret) => {
						console.log("lockInfo ret === " + ret)

						if (ret.code == 200) {
							that.detailAction(ret.lockId)
						} else {
							show.toastMessage(ret.message + "(" + ret.code + ")")
						}
					})
				}
			},
			detailAction(deviceNo) {
				this.$Router.push({
					name: 'lockApplyDetail',
					params: {
						deviceNo: deviceNo
					}
				})
			},
			cancel() {
				this.$Router.back()
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #DBDBDB;
		display: flex;
		justify-content: center;
		padding-top: 200rpx;
	}

	.content_view {
		width: 90%;
		height: 100%;
		border-radius: 20rpx;
		background-color: #FFFFFF;
		display: flex;
		flex-direction: column;
		// justify-content: center;
		align-items: center;

		.title_view {
			margin-top: 50rpx;
			margin-bottom: 100rpx;
		}

		.image_view {
			width: 240rpx;
			height: 240rpx;
			margin-bottom: 30rpx;
		}

		.des_view {
			margin-bottom: 60rpx;
		}

		.look_view {
			width: 90%;
			height: 80rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 40rpx;
			background-color: #A5A5A5;
			color: #FFFFFF;
			margin-bottom: 60rpx;
		}
	}
</style>